Skip to main content

All Questions

Tagged with
0votes
1answer
56views

How to send expression with variables over ssh?

I can run the followind loop locally for i in A B C; do mycommand $i; done Now I am trying to send it over ssh The following version ssh myhost for i in A B C; do mycommand $i; done The following ...
Dims's user avatar
  • 3,375
0votes
1answer
1kviews

Variable expansion with sh -c executed over ssh

I'm trying to execute an command via sh -c over SSH in an LXC container. Since lxc-attach is involved I have to use sh -c like this: ssh <host> "lxc-attach -- sh -c \"<command>;&...
Harry's user avatar
0votes
1answer
1kviews

Auto export a variable in every ssh session

I have a remote (Debian 8) machine that I log into via SSH. In my every ssh session I need to initialize a variable "XDEBUG_CONFIG" so that later I can use debugging tools during the same session. ...
Sergey Neskhodovskiy's user avatar
2votes
1answer
10kviews

Send variable with EOF and use host variable [duplicate]

I want to send variable from source to host, and exec host script. Here is my code : var1=1 ssh -p 42 root@xxx /bin/bash << EOF var2=2 echo $var1 echo $var2 EOF Return : 1 var1=1 ssh -p ...
callmemath's user avatar
2votes
2answers
1kviews

Exported variables inside ssh session are empty

I am trying to export a variable inside a ssh session and reference the variable in the next write command. sshpass -p "password" ssh -t -t my-box <<EOF export newUrl="this is a url" sudo -...
user avatar
0votes
1answer
935views

ssh pass multiple values

I want to open some ports i do for i in centos7{3..4};do ssh -T $i "for ir in 53 80 443 3000 3306 5910-5930 5432 8140 8443 10090-10100 20 21;do firewall-cmd --permanent --zone=public --add-port=$ir/...
elbarna's user avatar
  • 13.6k

close